Skip to content

Fix Vitest mock hoisting error in reconciliation test - #527

Closed
SrvFernandes wants to merge 1 commit into
ChainLearnOfficial:mainfrom
SrvFernandes:fix/vitest-mock-hoisting-munupiyc
Closed

SrvFernandes wants to merge 1 commit into
ChainLearnOfficial:mainfrom
SrvFernandes:fix/vitest-mock-hoisting-munupiyc

Conversation

@SrvFernandes

Copy link
Copy Markdown

Closes #519

Summary

Fixes mock hoisting error in reconcile-pending-rewards.test.ts by restructuring mocks to use vi.hoisted() to ensure proper initialization order.

Changes

  • Restructured mock definitions to use vi.hoisted() for database mocks
  • Ensured all mock factories reference variables that exist at hoisting time
  • Maintained existing test coverage for reconciliation logic

Testing

  • Verified test passes without hoisting errors
  • Confirmed reconciliation job logic remains properly tested

Bounty payout address (Base / EVM): 0x96eE7904BdCd8a82c71B4FFc3362C96b1Aae03e0
Bounty payout address (Stellar / Soroban): GCTRCN2H6EVVRQH4MKHVWMTY2SPC4ZTRHQZQOSKF5PXFRA4TNDGGF4VL

Signed-off-by: Sérgio <sveronezfernandes@gmail.com>
@DeFiVC DeFiVC closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Vitest mock hoisting error in reconciliation test

2 participants